package com.sdk4.jinritemai.model.request;

import com.alibaba.fastjson.annotation.JSONField;
import com.sdk4.jinritemai.DoudianRequest;
import com.sdk4.jinritemai.model.response.DoudianAddressModifyResponse;
import java.util.List;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@Data
public class DoudianAddressModifyRequest implements
    DoudianRequest<DoudianAddressModifyResponse> {
  private final String method = "order.addressModify";
  @JSONField(name = "order_id")
  private String orderId;
  @JSONField(name = "post_addr")
  private PostAddrBean postAddr;
  @JSONField(name = "post_tel")
  private String post_tel;
  @JSONField(name = "post_receiver")
  private String postReceiver;

  @Override
  public Class<DoudianAddressModifyResponse> getResponseClass() {
    return DoudianAddressModifyResponse.class;
  }

  @NoArgsConstructor
  @Data
  public static class PostAddrBean  {

    @JSONField(name = "address_detail",ordinal = 4)
    private String addressDetail;
    @JSONField(name = "city",ordinal = 1)
    private CityBean city;
    @JSONField(name = "land_mark",ordinal = 5)
    private String landMark;
    @JSONField(name = "province",ordinal = 0)
    private ProvinceBean province;
    @JSONField(name = "street",ordinal = 3)
    private StreetBean street;
    @JSONField(name = "town",ordinal = 2)
    private TownBean town;

    @NoArgsConstructor
    @Data
    public static class CityBean {

      @JSONField(name = "id",ordinal = 0)
      private String id;
      @JSONField(name = "name",ordinal = 1)
      private String name;
    }

    @NoArgsConstructor
    @Data
    public static class ProvinceBean {

      @JSONField(name = "id",ordinal = 0)
      private String id;
      @JSONField(name = "name",ordinal = 1)
      private String name;
    }

    @NoArgsConstructor
    @Data
    public static class StreetBean {

      @JSONField(name = "id",ordinal = 0)
      private String id;
      @JSONField(name = "name",ordinal = 1)
      private String name;
    }

    @NoArgsConstructor
    @Data
    public static class TownBean {

      @JSONField(name = "id",ordinal = 0)
      private String id;
      @JSONField(name = "name",ordinal = 1)
      private String name;
    }
  }
}
